package cn.zc.curriculum.service.service;

import cn.tools.core.VO.PageVO;
import cn.zc.curriculum.entity.CurriculumImg;
import cn.zc.curriculum.entity.Dto.CurriculumImgDto;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author keno
 * @since 2022-02-17
 */
public interface CurriculumImgService extends IService<CurriculumImg> {


    /**
     * 保存图片，并上传oss与本地
     * @param image
     * @param imgType
     * @return
     */
    String saveImgToData(MultipartFile image, String imgType);


    /**
     * 删除本地以及oss上的图片及数据库数据
     * @param id
     */
    void deleteCurriculumImg(String id);

    /**
     * 根据id或者类型查询图片数据
     * @param pageVO
     * @param id
     * @param imgType
     * @return
     */
    List<CurriculumImgDto> getCurriculumImg(PageVO pageVO, String id, String imgType);

    /**
     * 以base64形式返回图片
     * @return
     */
    String findLocalFileData(String id, HttpServletResponse response);


    /**
     * 流i形式返回图片
     * @param request
     * @param response
     * @param imgId
     */
    void findImageStream(HttpServletRequest request, HttpServletResponse response, String imgId);
}
